package com.yanqu.road.utils.executor;

import com.yanqu.road.utils.monitor.MonitorHelper;

import java.util.concurrent.ScheduledThreadPoolExecutor;

public class ScheduledThreadPoolHelper {

	public static ScheduledThreadPoolExecutor createGameScheduledThreadPoolExecutor(int corePoolSize, String threadName) {
		ScheduledThreadPoolExecutor poolExecutor = new GameScheduledThreadPoolExecutor(corePoolSize, new GeneralThreadFactory(threadName));
		MonitorHelper.monitorPool("pool-" + threadName, poolExecutor);
		return poolExecutor;
	}
}
